package com.xuyiwei.mayi.schedule;

import java.util.Timer;
import java.util.TimerTask;

/**
 * Created by xuyiwei on 2019/4/23.
 */
public class TimerDemo {
    public static void main(String[] args) {
        TimerTask task = new TimerTask() {
            @Override
            public void run() {


                    System.out.println("定时器执行");


            }
        };
        Timer timer = new Timer();
        timer.schedule(task,0,1000);
    }
}
